﻿using System;
using System.Collections.Generic;
using System.Text;

namespace EnterpriseWebsiteUtil.Attributes
{
    public enum LangType
    {
        zh = 0,
        en = 1,
    }

    [AttributeUsage(AttributeTargets.Property, Inherited = true)]
    public class LangSplitFieldAttribute : Attribute
    {
        public LangType Lang { set; get; }

        public string Field { set; get; }

        public LangType EmptyReplace { set; get; }

        /// <summary>
        /// 用正则来过滤不需要的内容
        /// </summary>
        public string FilterValue { set; get; }

        public LangSplitFieldAttribute(string Field, LangType lang = LangType.zh, LangType emptyReplace = LangType.zh, string filterValue = null)
        {
            this.Lang = lang;
            this.Field = Field;
            this.EmptyReplace = emptyReplace;
            this.FilterValue = filterValue;
        }
    }
}
